package com.wh.codedemon.design.pattern.singleton;

/**
 * TODO
 * 类装载时初始化：利用ClassLoader的机制，当类被加载时就完成了实例化
 * @auther whoo7
 * @date 2024/1/1 21:36
 */
public class HungrySingleton2 {
    private static HungrySingleton2 INSTANCE;

    static {
        INSTANCE = new HungrySingleton2();
    }

    public HungrySingleton2() {
    }

    public static HungrySingleton2 getInstance() {
        return INSTANCE;
    }
}
